home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / wildcat / msi_net.zip / MSI-ECHO.SCR < prev    next >
Text File  |  1992-08-26  |  8KB  |  328 lines

  1. ;  Script Date:  8/26/92
  2. ;
  3. ;  - If you have ANY ideas or questions about the script please drop me a
  4. ;    note.
  5. ;  - If you are going to use it on a system other than the MSI HQ BBS
  6. ;    you MUST change line 34 to reflect new QWK_PACKET name!
  7. ;                                           -Robert Cole
  8.  
  9. TurnON   8_BIT
  10. TurnOFF  LINEFEED
  11. TurnOFF  NOISE
  12. TurnOFF  MUSIC
  13. TurnOFF  SCROLL
  14. TurnOFF  PRINT
  15. TurnOFF  SPLIT
  16. TurnOFF  DOORWAY
  17. GRAPHICS ANSI
  18.  
  19. COLORBG 0
  20. COLORFG 14
  21. CLRSCR
  22.  
  23. STRING NAME
  24. STRING QWK_PACKET
  25. STRING PHONE
  26. STRING PREFIX
  27. STRING INIT
  28. STRING MAX_REDIAL
  29. STRING LOGIN_NAME
  30. STRING PWORD,ANSWER
  31. ASSIGN 0 1                         ; Redial counter.
  32. ASSIGN 1 5                         ; Number of Init tries.
  33. ASSIGN 3 "INITIALIZED"             ; Fill variable with initial value.
  34. ASSIGN QWK_PACKET MUSTANG    ; Assign first 8 chars of the QWK QWK_PACKET here.
  35.  
  36. EXIST $QWK_PACKET.CFG GO
  37. QUES1:
  38.   ATWRITE 1,1,11,"Enter the name of the system you are calling:"
  39.   GOTOXY 1 2
  40.   DISPLAYLN "[───────────────────────────────]"
  41.   GOTOXY 2 3
  42.    GETN NAME 30
  43. QUES2:
  44.   ATWRITE 1,4,11,"Enter the login name that you call to get mail with (DON'T ADD A ! TO YOUR NAME)"
  45.   GOTOXY 1 5
  46.   DISPLAYLN "[───────────────────────────────]"
  47.   GOTOXY 2 6
  48.    GETN LOGIN_NAME 30
  49. QUES3:
  50.   ATWRITE 1,7,11,"Enter the password (14 chars max):
  51.   GOTOXY 1,8
  52.   DISPLAYLN "[──────────────]"
  53.   GOTOXY 2 9
  54.    GETN PWORD 14
  55. QUES4:
  56.   ATWRITE 1,10,11,"Enter The phone number to dial (Default: 1-805-334-2243):
  57.   ATWRITE 1,11,11,"MAKE SURE TO ADD THE 1- if you are calling long distance!!"
  58.   GOTOXY 1 12
  59.   DISPLAYLN "[──────────────]"
  60.   GOTOXY 2 13
  61.    GETN PHONE 12
  62.     IF "$PHONE" = "" LOAD_DEFAULT_NUMBER
  63. QUES5:
  64.   ATWRITE 1,14,11,"Enter the max NUMBER of redial attempts to this system (Max 999):
  65.   GOTOXY 1 15
  66.   DISPLAYLN "[───]"
  67.   GOTOXY 2 16
  68.    GETN MAX_REDIAL 3
  69. QUES6:
  70.   ATWRITE 1,17,11,"Enter your custom initialization string here (Default: ATZ):
  71.   GOTOXY 1 18
  72.   DISPLAYLN "[────────────────────────────────────────]"
  73.   GOTOXY 2 19
  74.    GETN INIT 40
  75.    IF "$INIT" = "" LOAD_DEFAULT_INIT
  76. QUES7:
  77.     COLORFG 11
  78.     GOTOXY 1 20
  79.     DISPLAY "Do you have [T]one or [P]ulse dialing (Default: Tone)(T/P)? "
  80.     GETN PREFIX 1
  81.      IF "$PREFIX" = "P" ASSIGN_PULSE
  82.      IF "$PREFIX" = "T" ASSIGN_TONE
  83.      IF "$PREFIX" = "" ASSIGN_TONE
  84. QUES8:
  85.   CLRSCR
  86.   ATWRITE 1,1,11,"Do you want this script to pick up the line and"
  87.   ATWRITE 1,2,11,"send a message to a use who is trying to call the BBS"
  88.   GOTOXY 1 3
  89.   DISPLAY "telling them to call back later Y/n? "
  90.   GETN ANSWER 1
  91.      IF "$ANSWER" = "Y" ASSIGN_Y
  92.      IF "$ANSWER" = "N" ASSIGN_N
  93.      IF "$ANSWER" = "" ASSIGN_Y
  94. WRITE_INFO:
  95.   OPENFILE $QWK_PACKET.CFG REWRITE
  96.    WRITEFILE "$NAME"
  97.    WRITEFILE "!$LOGIN_NAME"
  98.    WRITEFILE "$PWORD"
  99.    WRITEFILE "$PHONE"
  100.    WRITEFILE "$MAX_REDIAL"
  101.    WRITEFILE "$INIT"
  102.    WRITEFILE "$PREFIX"
  103.    WRITEFILE "$ANSWER"
  104.   CLOSEFILE
  105.   GOTO GO
  106.  
  107. LOAD_DEFAULT_NUMBER:
  108.   ASSIGN PHONE 1-805-334-2243
  109. GOTO QUES5
  110.  
  111. LOAD_DEFAULT_INIT:
  112.   ASSIGN INIT ATZ
  113. GOTO QUES7
  114.  
  115. ASSIGN_TONE:
  116.   ASSIGN PREFIX T
  117. GOTO QUES8
  118.  
  119. ASSIGN_PULSE:
  120.   ASSIGN PREFIX P
  121. GOTO QUES8
  122.  
  123. ASSIGN_Y:
  124.   ASSIGN ANSWER Y
  125. GOTO WRITE_INFO
  126.  
  127. ASSIGN_N:
  128.   ASSIGN ANSWER N
  129. GOTO WRITE_INFO
  130.  
  131. SEND_MESSAGE:
  132.  WHEN               ; Clear WHEN's
  133.  TimeOut 10 START
  134.  Waitfor "RING"
  135.  IF "$ANSWER" = "N" WAIT_4_SILENCE
  136.  TimeOut 60 REINIT
  137.    Waitfor "RING"
  138.    Delay 500
  139.    Send "ATA^M"
  140.    Waitfor "CONNECT"
  141.    Delay 3000
  142.    Send "The system is currently attempting to make an outgoing call.^M^J"
  143.    Send "Please hang up and try back later."
  144.    Delay 2000
  145.  HANGUP
  146. GOTO REINIT
  147.  
  148. WAIT_4_SILENCE:
  149.  CLRSCR
  150.   FLUSH ALL          ;  Flush the buffers to make sure of no stray RING's
  151.   TimeOut 15 INCREMENT
  152.   Waitfor "RING" WAIT_4_SILENCE
  153.  
  154. GO:          ;  Begin Main body of script
  155.  
  156. ;   Fill variables with preferences
  157.  
  158.   OPENFILE $QWK_PACKET.CFG READ
  159.     READFILE NAME        ; Read System name
  160.     READFILE LOGIN_NAME  ; Read in login name
  161.     READFILE PWORD       ; Read in password
  162.     READFILE PHONE       ; Read phone number
  163.     READFILE MAX_REDIAL  ; Read max redial attempts
  164.     READFILE INIT        ; Read init string.
  165.     READFILE PREFIX      ; Read in dialing prefix
  166.     READFILE ANSWER      ; Read in call collision preference
  167.   CLOSEFILE
  168.  
  169. LOG $QWK_PACKET.LOG          ; Turn on logging.
  170. CAPTURE $QWK_PACKET.CAP      ; Turn on session capture.
  171.  
  172. ASSIGN 6 1  ; Current number of tries
  173. REINIT:
  174.  TimeOut 10 REINIT
  175.  CLRSCR
  176.  COLORFG 0
  177.  COLORBG 0
  178.  IF "$6" = "$1" NO_MODEM_RESPONSE
  179.   ATWRITE 1,1,11,"Modem Init Attempt Number $6 of $1"
  180.   GOTOXY 5 5
  181.   SEND "$INIT^M"
  182.   INCR 6
  183.   WAITFOR "OK"           ; Get modem response.
  184.   PAUSE 3000
  185.   SEND "ATX4E0M0^M"      ; HST's and HST/DS's needs X4 to run this script!
  186.   WAITFOR "OK"           ; Get modem response.
  187.  
  188.  TimeOut 60 START
  189. START:
  190.  CLRSCR
  191.   WHEN
  192.   WHEN "RING" SEND_MESSAGE
  193.   WHEN "BUSY" INCREMENT
  194.   WHEN "NO DIAL" INCREMENT
  195.   WHEN "NO CARRIER" START
  196.   COLOR 30
  197.   BOX 10,5,65,15
  198.  CLRSCR
  199.    GOTOXY 4 1
  200.   DISPLAY " Dialing $NAME at $TIME"
  201.    GOTOXY 17 3
  202.   DISPLAY "Try Number $0 of $MAX_REDIAL"
  203.    GOTOXY 12 5
  204.   DISPLAY "Message From Modem: "
  205.   WINDOW 42 10 55 12
  206.   COLORFG 11
  207.  
  208.  TIMEOUT 30 START ; Increase/Decrease as needed to match S7 register in modem.
  209.   DELAY 3000
  210.   SEND "ATD$PREFIX$PHONE^M"
  211.    GOTOXY 1 1
  212.   WAITFOR "CONNECT"
  213.   DELAY 1000
  214.   IF $ONLINE SKIP
  215.    INCREMENT:
  216.     IF "$0" = "$MAX_REDIAL" END
  217.     INCR 0
  218.     Delay 9000    ;  Delay for 9 seconds before next attempt.
  219.   GOTO START
  220.  
  221. SKIP:
  222.  COLORBG 0
  223.  TimeOut 30 FIRST_NAME
  224.   WINDOW 1,1,80,24
  225.  CLRSCR
  226.   WHEN                   ; Clear Above WHEN "BUSY" setting
  227.   WHEN "[C]ont" "^M"     ; Watch for long prelog screen
  228.   WHEN "CAUTION!" "^M"
  229.   WHEN "[y/N]" "^M"
  230.   WHEN "correctly" "^M"
  231.   WHEN "first name" SEND_NAME
  232.   WHEN "-PAUSE-" "^M"
  233.   WHEN "[S]top" "^M"
  234.   WHEN "NO CARRIER" START
  235.  
  236. FIRST_NAME:
  237.   Waitfor "your first name"
  238.   Delay   100
  239. SEND_NAME:
  240.   Send "$LOGIN_NAME^M"
  241.   PAUSE 1000
  242.   Send "^M"
  243.   Waitfor "Password?"
  244.   Send "$PWORD"
  245.   TimeOut 30 TOMCAT_MENU
  246.   WHEN                   ; Clear above WHEN's
  247.   WHEN "first name" SKIP
  248.   WHEN "PACKER MENU" SELECT_PACKER
  249.   WHEN "PROTOCOL MENU" SELECT_PROTOCOL
  250.   WHEN "NO CARRIER" START
  251.  GOTO TOMCAT_MENU
  252.  
  253. SELECT_PACKER:
  254.  Send "Z"
  255.  GOTO DOWNQWK
  256.  
  257. SELECT_PROTOCOL:
  258.   Send "Z"
  259.  GOTO DOWNQWK
  260.  
  261. TOMCAT_MENU:
  262.   Send "^M"
  263.   Waitfor "TOMCAT MENU"  ; Tomcat Main Menu Prompt
  264.   Delay   300
  265.   When "load!" TEST_FOR_REP
  266.   Send    "D"
  267.  
  268. DOWNQWK:
  269.  TimeOut 900 TOMCAT_MENU
  270.   Waitfor "done?"
  271.   Delay   100
  272.   Send    "Y"
  273.   Waitfor "now"
  274.   Download Z $DLPATH
  275.   IF $FAIL TOMCAT_MENU
  276.   WHEN
  277.  
  278. TEST_FOR_REP:
  279.    EXIST $ULPATH$QWK_PACKET.REP UPLOAD_REP  ; Test for existence of reply QWK_PACKET
  280.  GOTO END
  281.  
  282. SELECT_PACKER_UPLOAD:
  283.  Send "Z"
  284.  GOTO CONTINUE_REP_UPLOAD
  285.  
  286. SELECT_PROTOCOL_UPLOAD:
  287.   Send "Z"
  288.  GOTO CONTINUE_REP_UPLOAD
  289.  
  290. UPLOAD_REP:              ; Subroutine for uploading reply QWK_PACKET
  291.  TimeOut 30 UPLOAD_REP
  292.   WHEN
  293.   WHEN "PACKER MENU" SELECT_PACKER_UPLOAD
  294.   WHEN "PROTOCOL MENU" SELECT_PROTOCOL_UPLOAD
  295.   Send     "^M"
  296.   Waitfor  "TOMCAT MENU"
  297.   Delay    300                 ; Once a reply QWK_PACKET is uploaded successfully
  298.   Send     "U"                 ; You may hang up. Tomcat will continue to
  299. CONTINUE_REP_UPLOAD:
  300.   Waitfor  "now"               ; insert your messages and the board will
  301.   UPLOAD Z $ULPATH$QWK_PACKET.REP  ; recycle when Tomcat is done. This script hangs
  302.   Waitfor  "ing reply QWK_PACKET"  ; up as soon as the reply QWK_PACKET is uploaded.
  303.   IF $SUCCESS DELETE_REP_QWK_PACKET
  304.   GOTO UPLOAD_REP              ; It failed, try upload again.
  305. DELETE_REP_QWK_PACKET:
  306.   DOS "DEL $ULPATH$QWK_PACKET.REP"
  307.  GOTO END
  308.  
  309. END:
  310.  WHEN
  311.  HANGUP
  312.  TimeOut 10 END
  313.   Send "ATM0H1^M"
  314.   Waitfor "OK"
  315.  TURNOFF LOG
  316.  TURNOFF CAPTURE
  317.  SYSTEM X
  318.  
  319. NO_MODEM_RESPONSE:
  320.  OPENFILE $QWK_PACKET.ERR REWRITE
  321.   WRITEFILE **********************
  322.   WRITEFILE "No Modem Response given on $DATE at $TIME after $6 Tries"
  323.  CLOSEFILE
  324.   STAMP ********************
  325.   STAMP Failed to init the modem on $DATE at $TIME after $6 tries.
  326.  GOTO END
  327.  
  328.